package com.labirynt.impl;

import java.io.IOException;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;

import com.labirynt.GameObject;





public class Wall extends GameObject  {
	
    private Bitmap wallBmp;
	
	public Wall(String name,String animBmp, int x, int y, Context ctx)
	{
		super(name,x, y,(int) x+20,(int) y+32);
	  LoadAnimation(animBmp, ctx);
	}



	
	public void LoadAnimation(String animBmp, Context ctx) {
		try {
			  setWallBmp(BitmapFactory.decodeStream(ctx.getAssets().open(animBmp+".png"))); 
			  } 
		    catch (IOException e) { e.printStackTrace(); }
	}
	
	
	 
	
	



	public Bitmap getWallBmp() {
		return wallBmp;
	}




	public void setWallBmp(Bitmap wallBmp) {
		this.wallBmp = wallBmp;
	}



	@Override
	public void draw(Canvas canvas) {
		// TODO Auto-generated method stub
		
	}



	@Override
	public void Update(long now) {
		// TODO Auto-generated method stub
		
	}



	 public boolean isCollision(int x,int y)
	  {
		  return  (( x <this.spriteWidth
		    		&& x>this.xPos)
		    		||( y < this.yPos
		    		&& y > this.spriteHeight
		    		));
		  
	  }
	  
	  public boolean isCollisionWith(GameObject other)  
	  {
	    return  intersectRect( other);
	  }




	@Override
	public void SetPos(int x, int y) {
		// TODO Auto-generated method stub
		
	}





}
